<template>
    <div class="slider-container">
        <div class="slider">
            <div class="slide banner1">
                <div class="middle">
                    <div class="middle-item">
                        <img src="../../../assets/人流量 1.png" alt="" class="flow">
                        <div class="number"><span class="days">{{ warningTypes.massFlow }}</span><span
                                class="unit">天</span></div>
                        <div class="item-title">大流量预警</div>
                    </div>
                    <div class="middle-item">
                        <img src="../../../assets/客户关怀 1.png" alt="" class="warning-icon">
                        <div class="number"><span class="days warning">{{ warningTypes.careWarning }}</span><span
                                class="unit">人</span>
                        </div>
                        <div class="item-title">关怀预警</div>
                    </div>
                    <div class="middle-item">
                        <img src="../../../assets/人员登记 1.png" alt="" class="flow">
                        <div class="number"><span class="days">{{ warningTypes.upToOneRun }}</span><span
                                class="unit">人</span></div>
                        <div class="item-title">最多跑一次</div>
                    </div>
                </div>
                <div class="title">预警分类统计</div>
            </div>
        </div>
    </div>
</template>

<script>

import { warningType } from '@/api/statistics';

export default {
    name: "warningStatistics", // 预警分类统计
    components: {
    },
    props: {
        month: {
            type: String,
            // required: true,
        }
    },
    data() {
        return {
            nowMonth: null,
            warningTypes: {
                careWarning: '',
                upToOneRun: '',
                massFlow: ''
            }
        };
    },
    watch: {
        month(val) {
            // console.log('month', val);
            this.nowMonth = val;
            this.getWarningType()
        }
    },
    mounted() {

    },
    created() {

    },
    methods: {
        getWarningType() {
            let query = {
                month: this.nowMonth
            }
            warningType(query).then(res => {
                this.warningTypes = res.data;
            });
        }
    }
};
</script>


<style lang="scss" scoped>
.slider-container {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.slider {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.slide {
    min-width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner1 {
    background-image: url(../../../assets/banner3.png);
    padding: 0 227px;
    color: white;
}

.middle {
    margin-top: 300px;
    display: flex;
    justify-content: space-between;
    align-items: end;

    .middle-item {
        display: flex;
        flex-direction: column;
        align-items: center;

        .number {
            margin-top: 32px;
            margin-bottom: 22px;

            .days {
                font-size: 100px;
                font-family: "微软雅黑 ";
                font-weight: 500;
            }

            .unit {
                font-size: 28px;
            }
        }

        .item-title {
            font-size: 32px;
        }


    }
}

.flow {
    width: 116px;
    height: 116px;
}

.warning {
    color: #58f3fc;
}

.warning-icon {
    height: 152px;
    width: 124px;
}

.title {
    font-size: 60px;
    margin-top: 204px;
}
</style>